<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    #div1{
        margin: 100px 400px auto;
    }
    #div1 input {
        width: 80px;
        height: 30px;
        border: none;
        background:#CCC;
    }
    #div1 .active {
        background:red;
    }
    #div1 div {
        width:250px;
        height:200px;
        background:#f0f0f0;
        display:none;
    }

</style>
<body>
<div id="div1">
    <input class="active" type="button" value="教育">
    <input type="button" value="财经">
    <input type="button" value="aaa">
    <div style="display:block;">内容一</div>
    <div>内容二</div>
    <div>内容三</div>
</div>
<script src="jquery-3.1.1.js"></script>
<script>
    $(function ()
    {
        var oTab=new TabSwitch('div1');
    });
    function TabSwitch(id)
    {
        var oDiv=document.getElementById(id);
        this.aBtn=oDiv.getElementsByTagName('input');
        this.aDiv=oDiv.getElementsByTagName('div');
        var i=0;

        var _this=this;

        for(i=0;i<this.aBtn.length;i++)
        {
            this.aBtn[i].index=i;
            this.aBtn[i].onclick=function ()
            {
                _this.tab(this);
            };
        }
    }

    TabSwitch.prototype.tab=function (oBtn)
    {
        for(i=0;i<this.aBtn.length;i++)
        {
            this.aBtn[i].className='';
            this.aDiv[i].style.display='none';
        }
        oBtn.className='active';
        this.aDiv[oBtn.index].style.display='block';
    };
</script>
</body>
</html>